Skip to content

fix(web): project folders can be dragged into order in the Boring sidebar - #40164

Open
chisewaguri wants to merge 3 commits into
pingdotgg:mainfrom
chisewaguri:fix/sidebar-project-drag-reorder
Open

chisewaguri wants to merge 3 commits into
pingdotgg:mainfrom
chisewaguri:fix/sidebar-project-drag-reorder

Conversation

@chisewaguri

@chisewaguri chisewaguri commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In the Boring sidebar, project folders cannot be reordered. The redesign removed the old sidebar's project drag, so Manual order is frozen there. #33227 restores ordering through a list in Settings → Projects. This adds direct dragging in the sidebar.

Change

Folder headers drag like thread rows. The order saves through reorderProjects, and the first drag switches Project order to Manual. Moves stay inside the pinned, unpinned, or archived section, and a group moves with all its checkouts.

Verification

  • vp run check:changed passes.
  • The reorder scenario passes at a75956732f in 22.5s, including reload persistence, a drop outside the sidebar, and a release in a gap.
  • On base 13226b1c21, the same drag leaves the order unchanged.

Before, dragging, and after reload:

Base sidebar with beta above alpha after a drag attempt

Dragging the beta folder over alpha

Sidebar with alpha above beta after reload

Recording, 23s

Related to #33227 and #27062. The Settings list and the sidebar drag share the same saved order.

Note

Written by deepseek-4.1-flash on behalf of chise

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The sidebar now supports dragging project folders to reorder them. Folder drops update project order and can switch the client’s project sort order to Manual. Motion and shift-guard tracking now include rows nested inside folders.

Changes: Project folder reordering

Layer / File(s) Summary
Sortable folder rows
apps/web/src/components/sidebar/SidebarProjectFolder.tsx, apps/web/src/components/Sidebar.tsx
Project folders render as sortable rows with active threads nested below the header. Sorting is disabled when fewer than two folders exist.
Folder drag handling
apps/web/src/components/Sidebar.tsx
Folder drags use section-aware collision detection and release-point hit testing. Shared drag lifecycle handling also accounts for active folder drags.
Order update and validation
apps/web/src/uiStateStore.ts, apps/web/src/uiStateStore.test.ts, apps/web/src/components/Sidebar.tsx, scripts/scenarios/sidebar-project-folders-reorder.e2e.ts, docs/user/thread-sidebar.md
Folder drops update project order and set the client setting to Manual when needed. Tests cover grouped project keys, reload persistence, and drops outside folder targets. Documentation describes folder reordering.
Nested row position tracking
apps/web/src/components/Sidebar.motion.ts, apps/web/src/components/Sidebar.shiftGuard.ts, apps/web/src/components/Sidebar.shiftGuard.browser.test.ts
Motion and shift-guard tracking include rows inside folder groups. Browser tests check shifted-row behavior for top-level and nested rows.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant DndContext
  participant Sidebar
  participant uiStateStore
  participant ClientSettings
  User->>DndContext: Drag and release a project folder
  DndContext->>Sidebar: Send drag lifecycle events
  Sidebar->>Sidebar: Hit-test release point and select target folder
  Sidebar->>uiStateStore: Call reorderProjects with source and target keys
  Sidebar->>ClientSettings: Set project sort order to manual when needed
Loading

Suggested reviewers: juliusmarminge, t3dotgg

Merge Risk: Low · up to 7d149

Folder drag-and-drop reordering works with a pointer. Keyboard-only users cannot reorder folders, which is a bounded accessibility gap that can be handled as a follow-up. No other merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: project folders in the Boring sidebar can now be reordered by dragging. It follows the conventional commit format and matches the raw summary and PR objectives, which …
Description check Passed The description covers the problem, the change, and verification. It names the reorder behavior, the Manual order switch, the section constraint, and the checks run, with screenshots and a recording. …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: project folders in the Boring sidebar can now be reordered by dragging. It follows the conventional commit format and matches the raw summary and PR objectives, which describe folder drag-reordering with persistence.

Full details: Description check

Explanation

The description covers the problem, the change, and verification. It names the reorder behavior, the Manual order switch, the section constraint, and the checks run, with screenshots and a recording. It does not state a scope justification with a linked bug issue; it links #33227 and #27062 as related work, and the Scope section is absent. This is a minor gap, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 21, 2026
juliusmarminge and others added 2 commits November 21, 2026 06:33
…ease

The folder header keeps its pointer cursor like the draggable thread rows,
and release() again ignores rows that are fading out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1

apps/web/src/components/sidebar/SidebarProjectFolder.tsx: 1

90-90: Minor · Functional Correctness · Heavy lift

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Provide a keyboard reorder action.

The folder header receives only SidebarPointerSensor listeners. Keyboard activation toggles the folder, but cannot start a reorder. The drop handler also requires a pointer release point. Add a keyboard reorder action and commit its selected target without requiring pointer coordinates. (raw.githubusercontent.com)

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a759567 and 7d1499b.

Files selected for processing: 2

  • apps/web/src/components/Sidebar.motion.ts
  • apps/web/src/components/sidebar/SidebarProjectFolder.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@juliusmarminge juliusmarminge added takeover:needs-julius Takeover done; route gate says Julius decides and removed takeover:in-progress A takeover lead is working on this PR labels Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). takeover:needs-julius Takeover done; route gate says Julius decides vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants